package com.bdqn.controller;

import com.bdqn.base.R;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * IndexController
 *
 * @author LILIBO
 * @since 2023-02-22
 */
@RestController
@RequestMapping("/index")
public class IndexController {

    @GetMapping("/hi")
    @PreAuthorize("hasAuthority('test')")
    public String sayHi() {
        return "Hi 老王";
    }

    @GetMapping("/hello")
    @PreAuthorize("hasAuthority('test')")
    public R sayHello() {
        return R.success("Hello 老黄");
    }

}
